<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>login page</title>
<link id="themelink" rel="stylesheet" href="jslib/jquery-easyui-1.4/themes/default/easyui.css" type="text/css"></link>
<link rel="stylesheet" type="text/css" href="jslib/jquery-easyui-1.4/themes/icon.css">
<script type="text/javascript" src="jslib/jquery-easyui-1.4/jquery.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jslib/jquery-easyui-1.4/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="jslib/jquery.cookie.js"></script>
<script type="text/javascript" src="jslib/jsUtil.js"></script>
<script type="text/javascript">
	$(function() {

		$("#index_tree").tree({
			url : '${pageContext.request.contextPath}/menuAction!getAllTree.action',
			parentField : 'pid',
			lines : true,
			onLoadSuccess : function() {
				// $(this).tree('collapseAll');
			},
			onClick : function(node) {
				if (node.attributes.url) {
					addTab({
						title : node.text,
						href : '${pageContext.request.contextPath}' + node.attributes.url,
						closable : true
					});
				}
			}
		});

		var themes = [ {
			value : 'default',
			text : 'Default',
			group : 'Base'
		}, {
			value : 'black',
			text : 'Black',
			group : 'Base'
		}, {
			value : 'bootstrap',
			text : 'Bootstrap',
			group : 'Base'
		}, {
			value : 'gray',
			text : 'Gray',
			group : 'Base'
		}, {
			value : 'metro',
			text : 'Metro',
			group : 'Base'
		}, {
			value : 'ui-cupertino',
			text : 'ui-cupertino',
			group : 'UI'
		}, {
			value : 'ui-dark-hive',
			text : 'ui-dark-hive',
			group : 'UI'
		}, {
			value : 'ui-pepper-grinder',
			text : 'ui-pepper-grinder',
			group : 'UI'
		}, {
			value : 'ui-sunny',
			text : 'ui-sunny',
			group : 'UI'
		} ];
		$('#cb-theme').combobox({
			groupField : 'group',
			data : themes,
			editable : false,
			panelHeight : 'auto',
			onChange : onChangeTheme,
			onLoadSuccess : function() {
				var ck = "${cookie.easyuiThemeName.value}";
				if (ck.indexOf("easyuiThemeName") > 0) {
					ck = "default";
				}
				$("link[id=themelink]").attr('href', 'jslib/jquery-easyui-1.4/themes/' + ck + '/easyui.css');
				$(this).combobox('setValue', ck);
			}
		});
	});

	function onChangeTheme(theme) {
		$("link[id=themelink]").attr('href', 'jslib/jquery-easyui-1.4/themes/' + theme + '/easyui.css');
		$.cookie('easyuiThemeName', theme, {
			expires : 7
		});
	}

	function addTab(val) {
		var t = $("#index_centerTabs");
		if (t.tabs("exists", val.title)) {
			t.tabs("select", val.title);
		} else {
			t.tabs("add", val);
		}
	}
</script>

</head>

<body class="easyui-layout">
	<div data-options="region:'north',title:'North Title',split:true" style="height:100px;">
		<select id="cb-theme" style="width:120px"></select>
	</div>
	<div data-options="region:'south',title:'South Title',split:true" style="height:100px;"></div>
	<div data-options="region:'east',title:'East',split:true" style="width:100px;"></div>
	<div data-options="region:'west',title:'West'" style="width:250px;">
		<div id="aa" class="easyui-accordion" data-options="fit:true,border:false">
			<div title="Title1" data-options="iconCls:'icon-save',selected:true">
				<ul id="index_tree" class="easyui-tree"></ul>
			</div>
			<div title="Title2" data-options="iconCls:'icon-reload'" style="padding:10px;">content2</div>
		</div>
	</div>
	<div data-options="region:'center',title:'center title'" style="padding:5px;background:#eee;">
		<div id="index_centerTabs" class="easyui-tabs" data-options="fit:true,border:false">
			<div title="首页"></div>
		</div>
	</div>

	<jsp:include page="user/login.jsp"></jsp:include>

	<jsp:include page="user/reg.jsp"></jsp:include>

</body>
</html>
